import Vue from 'vue';
import VueRouter from 'vue-router';
Vue.use(VueRouter);
import HandPick from '../views/handpick/handpick.vue';
import classify from '../views/classify/classify.vue';
import brand from '../views/classify/brand.vue';
import kindbox from '../views/classify/kindbox.vue';
import rightbox from '../views/classify/rightbox.vue'
import opgc from '../views/opgc/opgc.vue';
import ifCanEat from '../views/opgc/ifCanEat.vue';
import rightCate from '../views/opgc/rightCate.vue';
import kindItem from '../views/opgc/kindItem.vue'
import ifCanDo from '../views/opgc/ifCanDo/ifCanDo.vue'
import doSearch from '../views/opgc/ifCanDo/doSearch/doSearch.vue'
import ageSearch from '../views/opgc/ifCanDo/ageSearch/ageSearch.vue'
import user from '../views/user/user.vue';
import cart from '../views/cart/cart.vue';
import goodsList from '../views/goodsList/goodslist.vue'
import footerNav from '../components/nav/footer.vue';
import home from '../views/home.vue'
import userSet from '../views/user/userSet/userSet.vue';
import goodsItem from '../views/goodsItem/goodsItem.vue';

import goodsDetail from '../views/goodsItem/goodsDetail.vue';
import goodsReview from '../views/goodsItem/goodsReview.vue';
import goods from '../views/goodsItem/goods.vue';
import detailSelect from '../views/goodsItem/detailSelect.vue'
import userOrder1 from '../views/user/userOrder/userOrder1.vue'
import search from '../views/search/search.vue'
import userOrder2 from '../views/user/userOrder/userOrder2.vue'
import userOrder3 from '../views/user/userOrder/userOrder3.vue'
import Service from '../views/user/userOrder/Service.vue'
import clause from '../views/user/usertool/clause.vue'
import message from '../views/user/userSet/message.vue'
import uservip from '../views/user/userSet/uservip.vue'
import register from '../views/user/userheader/register.vue'
import login from '../views/user/userheader/login.vue'
import ten from '../views/user/usertool/ten.vue'
import recruit from '../views/user/usertool/recruit.vue'
import presell from '../views/user/usertool/presell.vue'
import attention from '../views/user/usertool/attention.vue'
import collect from '../views/user/usertool/collect.vue'
import ticket from '../views/user/usertool/ticket.vue'
import sale from '../views/user/userOrder/sale.vue'
// import myhelp from '../views/user/userOrder/myhelp.vue'
const router = new VueRouter({
      mode:'history',
      routes:[
          {
              path:'/',
              component:footerNav,
              redirect:'/home'
          },

          {
            path:'/home',
            redirect:'/home/index',
            component:home,
            children:[
                {
                    path:'index',
                    component:HandPick
                },
                {
                    path:'classify',
                    redirect:'classify/tab1',
                    component:classify,
                    children:[
                        {
                            path:'tab1',
                            redirect:'tab1/721',
                            component:kindbox,
                            children:[
                                {
                                    path: ':id',
                                    component: rightbox
                                },
                            ]
                        },
                        {
                            path: 'tab2',
                            component: brand
                        }
                    ]


                },
                {
                    path:'opgc',
                    component:opgc,
                    children:[
                        {
                            path:'opgc/:param',
                            component:opgc
                        }
                    ]
                },
                {
                    path:'user',
                    component:user
                },
                // {
                //     path:'search',
                //     component:search
                // }
            ]
        },

        {
            path: '/goodslist/:cate_id',
            component: goodsList
        },
        {
            path: '/user/set',
            component: userSet,
        },
        {
            path: '/userorder1',
            component: userOrder1,


        },
        {
            path: '/userorder2',
            component: userOrder2,


        },
        {
            path: '/userorder3',
            component: userOrder3,


        },
        {
            path:'/service',
            component:Service,
            
        },

        {
            path:'/goods',
            redirect:'/goods/:gid',
            component:goods,
            children:[
                {
                    path:':gid',
                    component:goodsItem,
                },
                {
                    path:'detail/:gid',
                    component:goodsDetail,
                    redirect:'detail/:gid/1',
                    children:[
                        {
                            path:':id',
                            component:detailSelect
                        },

                    ]   
                },
                {
                    path:'review/:gid',
                    component:goodsReview   
                },
            ]},
            {

            path:'/ifCanEat',
            component:ifCanEat,
            redirect:'/ifCanEat/1',
            children:[
                {
                    path:":cid",
                    component:rightCate
                }
            ]
        },
        {
            path:'/goodslist/:cate_id',
            component:goodsList
        },
        {
            path:'/kindItem/:cid',
            component:kindItem
        },
        {
            path:'/ifCanDo',
            component:ifCanDo
        },
        {
            path:'/doSearch/:cid',
            component:doSearch
        },
        {
            path:'/ageSearch/:pid',
            component:ageSearch
        },
       
        {
            path:'/cart',
            component:cart
        },
        {
            path:'/user/set',
            component:userSet
        },
        {
            path:'/clause',
            component:clause
        },
        {
            path:'/message',
            component:message
        },
        {
            path:'/uservip',
            component:uservip
        },
        {
            path:'/register',
            component:register
        },
        {
            path:'/login',
            component:login
        },
        
        {
            path:'/ten',
            component:ten
        },
        {
            path:'/recruit',
            component:recruit
        },
        {
            path:'/presell',
            component:presell
        }
        ,{
            path:'/attention',
            component:attention
        },
        {
            path:'/collect',
            component:collect
        },
        {
            path:'/ticket',
            component:ticket
        },
        {
            path:'/sale',
            component:sale
        },
        // {
        //     path:'/myhelp',
        //     path:myhelp
        // }
        {
            path:'/search',
            component:search
        }


      
      ]

})
export default router;
